<div class="list-group dr-form" ng-init="init()">
    <h3 class="list-group-item-heading box-shadowbottom">
        广告管理
    </h3>
    <div class="list-group-item single-channel-quary">
        <div class="form-inline">
            <div class="div-display-box">       <div class="form-group"><p>&nbsp;</p></div></div>
            <div class="div-display-box" has-permission="qyj_banner_query">
                <div class="form-group">
                    <select name="bannerType" ng-model="viewModel.query.linkType" style="width: 195px;">
                        <option value="">--广告类型--</option>
                        <option ng-repeat="item in viewModel.dropDown.bannerTypes"
                                value="{{item.code}}">{{item.name}}
                        </option>
                    </select>
                </div>
                <div class="form-group">
                    <select name="imageStatu" id="imageStatu" ng-model="viewModel.query.isActive" style="width: 195px;">
                        <option value="">--启用状态--</option>
                        <option value="{{item.code}}" ng-repeat="item in viewModel.dropDown.imageStatus">{{item.name}}
                        </option>
                    </select>
                </div>
                <div class="form-group">
                    标题：
                    <input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-empty" placeholder="标题"
                           ng-model="viewModel.query.name">
                </div>
                <div class="form-group">
                    <button class="btn btn-default" ng-click="queryBanner()">查询</button>
                </div>
            </div>
            <div class="form-group float-lg-right">
                <button class="btn btn-primary btn-plr-15" ng-click="openBannerImageType('ml')"
                        has-permission="qyj_banner_add">
                    <i class="fa fa-plus"></i>
                    新建
                </button>
            </div>
        </div>
    </div>
    <div class="list-group-item single-channel-body">
        <hr>
        <div class="dr-tb-container">
            <table class="table table-striped table-condensed">
                <thead>
                <tr>
                    <th style="width:15%;">标题</th>
                    <th style="width:10%;">广告类型</th>
                    <th style="width:10%;">位置</th>
                    <th style="width:10%;">描述</th>
                    <th style="width:15%;">操作时间</th>
                    <!--<th style="width:10%;">开启</th>-->
                    <th style="width:10%;">状态</th>
                    <th style="width:20%;">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr class="ng-scope" ng-repeat="item in tableData.result">
                    <td class="ng-binding"><a style="color: #1ab394; cursor: pointer; " ng-click="query(item.id)">{{item.name}}</a>
                    </td>
                    <td class="ng-binding" style="cursor:pointer;">
                       <span style="color: #1ab394; cursor: pointer; " tooltips
                             tooltip-side="right"
                             tooltip-template-url="toolTipDialog.html"
                             tooltip-controller="BannerImageController"
                             tooltip-class="bg-tooltip">
                              {{item.linkType | linkFilter}}
                        </span>
                        <script type="text/ng-template" id="toolTipDialog.html">
                            <div class="row">
                                <div class="col-12" style="margin: 0px; padding: 0px;">
                                    <a href="{{item.linkContent}}" target="_blank">
                                        <img src="{{item.linkContent}}" width="300px" height="80px"
                                             ng-show="{{item.linkType=='image'?true:false}}">
                                    </a>
                                    <span ng-show="{{item.linkType=='text'||item.linkType=='link'?true:false}}">{{item.linkContent}}</span>
                                </div>
                            </div>
                        </script>
                    </td>
                    <td class="ng-binding">{{item.position}}</td>
                    <td class="ng-binding">{{item.description}}</td>
                    <td class="ng-binding">{{item.createTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                    <!--<td class="text-center">-->
                    <!--<switch id="enabled" name="enabled" ng-model="item.isActive" on="on" off="off" class="green"></switch>-->
                    <!--</td>-->
                    <td class="ng-binding"><i class="fa fa-circle-thin"
                                              id="{{item.isActive?'btn-start':'btn-enable'}}"></i>
                        {{item.isActive |statusFilter}}
                    </td>
                    <td class="text-center">
                        <!--<br>{{ enabled }}-->
                        <button type="button" has-permission="qyj_banner_detail"  class="btn btn-secondary" ng-click="query(item.id)">
                            <i class="fa fa-sign-in" aria-hidden="true"></i>查看
                        </button>
                        <div class="btn-group">
                            <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"
                                    aria-expanded="false"><i class="icon-icon-more" aria-hidden="true"></i>更多
                            </button>
                            <ul class="dropdown-menu" role="menu">
                                <li has-permission="qyj_banner_detail">
                                    <a href="" ng-click="edit(item.id)">编辑</a>
                                </li>
                                <li has-permission="qyj_banner_delete">
                                    <a ng-confirm="delete(item.id)"
                                       ng-confirm-message="删除操作不可恢复，确认要删除{{item.name}}数据项吗?" href=""
                                       class="ng-isolate-scope">删除</a>
                                </li>
                            </ul>
                        </div>
                    </td>
                </tr>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="8" class="text-center text-bg">
                        <div class="text-right" page-control record="tableData" evname="dr.reloadPagination"></div>
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>


